<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-9-6
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class TagsDB  extends DBReader{

    //根据tag_id 获取tag 信息
    public function get($tag_id){

        $sql = 'select tag_id, tag_name from tags where tag_id = :tag_id';

        return $this->db()->getRow($sql,array('tag_id'=>$tag_id));
    }

    //批量获取标签信息
    public function mulitGetTagInfoByNames($tag_names){

        $sql = 'select tag_id, tag_name from tags where tag_name in('.$tag_names.')';

        return $this->db()->getAll($sql);
    }
}